import 'package:flutter_test/flutter_test.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit/media_kit_platform_interface.dart';
import 'package:media_kit/media_kit_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMediaKitPlatform
    with MockPlatformInterfaceMixin
    implements MediaKitPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MediaKitPlatform initialPlatform = MediaKitPlatform.instance;

  test('$MethodChannelMediaKit is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMediaKit>());
  });

  test('getPlatformVersion', () async {
    MediaKit mediaKitPlugin = MediaKit();
    MockMediaKitPlatform fakePlatform = MockMediaKitPlatform();
    MediaKitPlatform.instance = fakePlatform;

    expect(await mediaKitPlugin.getPlatformVersion(), '42');
  });
}
